package com.hmdp;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * 继承SpringBootServletInitializer 提供SpringBoot项目启动器（初始化项目内部servlet组件）
 */
@MapperScan("com.hmdp.mapper")
@SpringBootApplication
public class HmDianPingApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(HmDianPingApplication.class, args);
    }

    // 重写父类的configure()方法
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        //return super.configure(builder);
        // 指定初始化的项目启动类
        return builder.sources(HmDianPingApplication.class);
    }
}
